<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>后台管理系统登录</title>
<script type="text/javascript" src="${ctx}/resources/plugins/jquery-easyui-1.4.3/jquery.min.js"></script>
<style type=text/css>
body {
	text-align: center;
	padding-bottom: 0px;
	background-color: #ddeef2;
	margin: 0px;
	padding-left: 0px;
	padding-right: 0px;
	padding-top: 0px
}

a:link {
	color: #000000;
	text-decoration: none
}

a:visited {
	color: #000000;
	text-decoration: none
}

a:hover {
	color: #ff0000;
	text-decoration: underline
}

a:active {
	text-decoration: none
}

.input {
	border-bottom: #ccc 1px solid;
	border-left: #ccc 1px solid;
	line-height: 20px;
	width: 182px;
	height: 20px;
	border-top: #ccc 1px solid;
	border-right: #ccc 1px solid
}

.input1 {
	border-bottom: #ccc 1px solid;
	border-left: #ccc 1px solid;
	line-height: 20px;
	width: 120px;
	height: 20px;
	border-top: #ccc 1px solid;
	border-right: #ccc 1px solid;
}
</style>
<script type="text/javascript">
// 	function login(){
// 		var userName=$("#userName").val();
// 		var password=$("#password").val();
// 		var roleName=$("#roleName").val();
// 		if(userName==null||userName==""){
// 			alert("用户名不能为空！");
// 			return;
// 		}
// 		if(password==null||password==""){
// 			alert("密码不能为空！");
// 			return;
// 		}
// 		if(roleName==null||roleName==""){
// 			alert("请选择用户类型！");
// 			return;
// 		}
// 		$("#adminlogin").submit();			
		
// 	}
	
	
	// 记住密码变换
	 function Rememberpwd() {
		var type = $("#rememberpwd").attr("class");
		if (type == 'select') {
			$("#rememberpwd").attr("class", "selected");
		} else {
			$("#rememberpwd").attr("class", "select");

		}
	}
    
	// 登录后
	function lgUser(rs) {
		if (rs.code == "0000") {
			window.location.href = "${root}/index";
		} else {
			alert(rs.msg);
		}
	}
	
	// 登录
   function login() {
	//	SetPwdAndChk();
		var name = $("#username").val();
		var pwd = $("#password").val();

		if (name.replace(/\s+/g, "") == "") {
			alert("用户名不能为空!");
			return; 
		}
		if (pwd.replace(/\s+/g, "") == "") {
			alert("密码不能为空");
			return;
		}
		
		$.ajax({
			url:  '${ctx}/sys/authen/login.do' ,
			data:{username : name,password : pwd},
			success:function(rs){
				if (rs.code == "0000") {
					window.location.href = "${ctx}/main.jsp";
				} else {
					alert(rs.msg);
				}
			},
			error:function(e){
				alert('系统异常') ;
			}
		});
	}
	
</script>
</head>
<body>
<FORM id=adminlogin  method=post
	name=adminlogin action="${ctx}/sys/authen/login.do"  >
<DIV></DIV>
<TABLE style="MARGIN: auto; WIDTH: 100%; HEIGHT: 100%" border=0
	cellSpacing=0 cellPadding=0>
	<TBODY>
		<TR>
			<TD height=150>&nbsp;</TD>
		</TR>
		<TR style="HEIGHT: 254px">
			<TD>
			<DIV style="MARGIN: 0px auto; WIDTH: 936px"><IMG
				style="DISPLAY: block" src="${ctx}/resources/images/body_03.jpg"></DIV>
			<DIV style="BACKGROUND-COLOR: #278296">
			<DIV style="MARGIN: 0px auto; WIDTH: 936px">
			<DIV
				style="BACKGROUND: url(${ctx}/resources/images/body_05.jpg) no-repeat; HEIGHT: 155px">
			<DIV
				style="TEXT-ALIGN: left; WIDTH: 265px; FLOAT: right; HEIGHT: 125px; _height: 95px">
			<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
				<TBODY>
					<TR>
						<TD style="HEIGHT: 45px"><INPUT type="text" class="input" id="username"   name="username" id="userName"></TD>
					</TR>
					<TR>
						<TD><INPUT type="password" class="input"   name="password" id="password"/></TD>
					</TR>
					<TR>
<!-- 						<td> -->
<!-- 							<select id="roleName" name="roleName" class="input" style="margin-top: 15px;height: 24px"> -->
<!-- 								<option value="">请选择用户类型...</option> -->
<%-- 								<option value="系统管理员"  ${'系统管理员'==user.roleName?'selected':'' }>系统管理员</option> --%>
<%-- 								<option value="销售主管"  ${'销售主管'==user.roleName?'selected':'' }>销售主管</option> --%>
<%-- 								<option value="客户经理"  ${'客户经理'==user.roleName?'selected':'' }>客户经理</option> --%>
<%-- 								<option value="高管"  ${'高管'==user.roleName?'selected':'' }>高管</option> --%>
<!-- 							</select> -->
<!-- 						</td> -->
					</TR>
				</TBODY>
			</TABLE>
			</DIV>
			<DIV style="HEIGHT: 1px; CLEAR: both"></DIV>
			<DIV style="WIDTH: 380px; FLOAT: right; CLEAR: both">
			<TABLE border=0 cellSpacing=0 cellPadding=0 width=300>
				<TBODY>
					
					<TR>
						<TD width=100 align=right><INPUT
							style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px"
							id=btnLogin src="${ctx}/resources/images/btn1.jpg" type=image name=btnLogin onclick="javascript:login();return false;"></TD>
						<TD width=100 align=middle><INPUT
							style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px"
							id=btnReset src="${ctx}/resources/images/btn2.jpg" type=image name=btnReset onclick="javascript:adminlogin.reset();return false;"></TD>
					</TR>
				</TBODY>
			</TABLE>
			</DIV>
			</DIV>
			</DIV>
			</DIV>
			<DIV style="MARGIN: 0px auto; WIDTH: 936px"><IMG
				src="${ctx}/resources/images/body_06.jpg"></DIV>
			</TD>
		</TR>
		<TR style="HEIGHT: 30%">
			<TD>&nbsp;</TD>
		</TR>
	</TBODY>
</TABLE>
</FORM>
</body>
</html>
<script type=text/javascript>
	if('${errorMsg}'!=''){
		alert('${errorMsg}');
	}
</script>